package com.my.hotel.service.impl;

import com.alibaba.druid.sql.visitor.functions.Char;
import com.my.hotel.entity.Eva;
import com.my.hotel.mapper.TbEvaMapper;
import com.my.hotel.service.TbEvaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Array;
import java.util.List;

@Service
public class TbEvaServiceImpl implements TbEvaService {
    @Autowired
    private TbEvaMapper tbEvaMapper;

    public List<Eva> getList(String app_status) {
        return tbEvaMapper.getList(app_status);
    }

    public void delEva(int id) {
        tbEvaMapper.delEva(id);
    }

    public void updEva(int id) {
        tbEvaMapper.updEva(id);
    }

    @Transactional
    public void delAllEva(String id) {
        String[] strs = id.split(",");
        for (String str : strs) {
            tbEvaMapper.delAllEva(str);
        }
    }

    @Transactional
    public void updateAllEva(String id) {
        String[] strs = id.split(",");
        for (String str : strs) {
            tbEvaMapper.updateAllEva(str);
        }
    }
}
